package {{ packageName }}.sample.infrastructure.secondary;

import {{ packageName }}.IntegrationTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static {{ packageName }}.sample.domain.BeersIdentityFixture.cloackOfFeathersId;
import static {{ packageName }}.sample.domain.beer.BeersFixture.beer;
import static org.assertj.core.api.Assertions.assertThat;

@IntegrationTest
class CassandraBeerRepositoryIT {

  @Autowired
  private CassandraBeerRepository beers;

  @Test
  void shouldSaveAndGetBeer() {
    beers.save(BeerTable.from(beer()));

    assertThat(beers.findById(cloackOfFeathersId().get()).orElseThrow().toDomain()).usingRecursiveComparison().isEqualTo(beer());
  }
}
